מרצה:מתי בוט
מבנה ההרצאה חלק א' 1 (הסבר על הסימולטור.Torcs 2 (הסבר על תחרות EvoStar 2010 ביחד עם הדגמה של.GA חלק ב' הסבר על המאמר The WCCI 2008 Simulated Car Racing Competition, CIG08
חלק א' 1 Torcs - The Open Racing Car Simulator Computer Game-3D Car Racing Game. Open Source. website: http://torcs.sourceforge.net/ Can change the code, add features and customize it for research. Portable for Windows, Mac, Linux. Features nice graphics. Good physics engine. (will be explained next) = good(not perfect) simulation of reality Ability to easily use and manage generic bots as driver controllers very good for us. Use AI Manage Communication with a distant controller(will be explained) Ability for people to play against other Bots in one race. Fully automatic Bots vs. Bots without human-in-the-loop.
Torcs-Physics Engine Gravity Model Collision Detection for both walls and other cars Damage Simulation (10,000 damage points) Different Surfaces: road, grass or sand. Obstacles. Comprehensive Car Physics Simulationwill be seen in demo.
Torcs-Physics Engine-Car Setup Aerodynamics Friction Car Design Tire Properties Spring Stiffness Gear Brakes הערה חשובה:אלו הפרמטרים שאנו רוצים לעשות להם אופטימיזציה בקורס.
Torcs Controller Sensors Each driver can access sensors. In order to make good decisions while driving. Fuel Damage Speed Location Other cars locations RPM Gear Race Position Wheel Spin Velocity
הדגמה של הסימולטור
חלק א' 2: תחרות EvoStar מהלך התחרות: כל משתמש צריך לשלוח אלגוריתם אופטימיזציה לבעיית.Car-Setup הזמן המקסימלי האפשרי להרצת האלגוריתם הוא מיליון tics של משחק. כל אלגוריתם משתתף ירוץ על 3 מסלולים שונים עם מספר הרצות קבוע. תהליך הניקוד יעבוד רק על הפתרון הטוב ביותר שנמצא הניקוד של הפתרון הטוב ביותר יהיה המרחק שהמכונית עברה מנק' ההתחלה הערה:הAI של ה driver-controller יהיה זהה לכל המשתתפים
חלק א' 2: תחרות EvoStar בעיית האופטימיזיה: מציאת 22 הפרמטרים ההתחלתיים הטובים ביותר עבור מכונית לפני תחילת המירוץ
חלק א' 2: אפליקציית הGA של התחרות.Torcs מבוסס על בעל 2 חלקים: EvoStar -Torcs Simulation-Server עדכון שמוסיפים לTorcs כדי לאפשר לClient להתחבר. )נראה בהמשך כיצד( - Java GA-Client מריץ את הGA עבור בעיית האופטימיזציה ומתחברת לTorcs בשביל מציאת ה- Fitness לאוכלוסיית הפתרונות.
ארכיטקטורת המערכת Torcs-car simulation Bot Opt-server Where each member is tested during the GA Result Stats(Performance): Damage of car Distance-raced Top-Speed Best-Lap UDP Initialization Params: The 22 params that were mentioned earlier. ResultStats Simulate-car(params) Car Optimization Genetic Algorithm
How it Should Work GA Fitness Function ff ServerCommunication sc Initialize() Select() Crossover(X,Y) Mutate(X) EvalAll(){ Foreach(x in pop){ Fx= launchsimulation(x,time) } } Run(){ sc.setfitnessfunction(ff) Initialize() evalall() for(i<=popsize/2){ X,Y =Select() X Y =Crossover(X,Y) X =Mutate(X ) Y =Mutate(Y ) newpop.add(x,y) } } We all need to implement later in our course FitnessFunction getfitness(bestlap, topspeed, distraced, damage) Already Exists ServerCommunication ServerCommunication(String ip, int port) Fitness launchsimulation(double[] values, int time) setfitnessfunction(fitnessfunction fitness)
הוראות התקנה להוריד את Torcs להוריד את הClient ולהתקין במחשב http://torcs.sourceforge.net/ התחרות http://cig.dei.polimi.it/ להעתיק וה- Server 2010( מהאתר של )EvoStar את התוכן של הקובץ של הServer לתיקיה של.Torcs
הוראות הפעלה יש להריץ את wtorcs.exe יש להגדיר את המירוץ: Race->Quick Race->Configure Race בנוסף, שי לבחור מהרשימה של הBots רק optserver את יש להריץ את הGA שבניתם כדי שיתחבר לסימולטור הערה: ניתן להריץ גם עם T "wtorcs.exe בלי גרפיקה.
הדגמה של SimpleGA
The WCCI 2008 חלק ב' Simulated Car Racing Competition מטרה: ליצור קונטרולר לTORCS שיוכל לנסוע הכי מהר גם לבד וגם בנוכחות של מכוניות אחרות תחרות בין Driver Controllers עבור סימולטור.Torcs )ובלי קשר לאופטימיזציות של פרמטרים( הנהגים נבחנו ב 3 מסלולים לא ידועים מראש. כולם נבחנו גם לבד במסלול וגם כולם ביחד במירוץ.
כיצד בנוי Controller כל Controller מימש פונקציה Effectors drive (Sensors)
ארכיטקטורת התחרות
המשתתפים בתחרות A.Leonard Kinnaird-Heether and Robert Reynolds Hand crafted from scratch+small GA B.Simon M.Lucas: Hacked controller improved default controller C.Matt Simmerson:NEAT controller evolving a neural network using NEAT. D.Diego Perez and Yago Saez:Rule-based controller Evolve set of rules E.Chin Hiong Tan and Kay Chen Tan 3 step process
A.Leonard Kinnaird-Heether and Robert Reynolds Hand crafted from scratch+small GA Implemented in Java Idea: Simple not-trained controller that doesn t get stuck Rules: Accelaration-Stay in target speed(will be explained). Steering-Find the way to the furthest edge of track. Shifting-decides from RPM sensor
A.Leonard Kinnaird-Heether and Robert Reynolds Hand crafted from scratch (Continued) Error Correction-falls into 3 categories Wrong Direction Yes/No not in +-90 from track normal fix it by turning Not on track Yes/No slow down and fix Car is Stuck Yes/No Time Counter-then reverse Simultaneous Errors Handle Hierarchically Stuck->Wrong Direction- >Off Track
A.Leonard Kinnaird-Heether and Robert Reynolds Hand crafted from scratch (Continued) Target Speed-Calculation using GA Given the deviation angle from the track s (+-90 degree) return the Target speed Devide the deviations to sections 0-10,11-20,21-30 etc For each section calculate the target speed. Fitness function-distance from starting point for a certain amount of game ticks.
B.Simon M.Lucas: Hacked controller improved default controller Steps: Improved the SimpleSoloController (Default Controller of the contest) Changed target speed from 100km/h to 250km/h Introduced a new safe mode-when range finder finds something- new target speed 50km/h While in Safe mode. If Speed>BreakSpeedLimit(=105 initially) then break and accel=false Steering mode, when car deviated from center of track(more than TrackPosLimit).target speed is reduced by factor of 1.5. 250->167(original by factor of 2 from 100->50) TargetAngle=TrackFac*TrackPos if <0.01 then 0.005 MaxSteeringAngle reduced with Speed * SteeringFac steeringfac(0.35),trackfac(0.38),breakspeedlimit(105),trackpositionlimit(0.15) Insufficient time to use EA to evolve better params
C.Matt Simmerson:NEAT controller evolving a neural network using NEAT. Evolving a neural network using the NEAT Algorithm (Using NEAT4J Impl) All inputs (from sensors) were normalized to [-1,1] or [0,1] depending on the parameter. Initial controllers were simple. 3 inputs connected to 3 outputs. Neural networks. Crossover and Mutation is defined by NEAT algorithm Selection was Tournament based(each eval 2 are competing, and the fittest is chosen. Training on one track-technical difficulty Pop size=100 Time=4000 Game Ticks
C.Matt Simmerson:NEAT controller evolving a neural network using NEAT.(Continued) Fitness Function = Fc =(2*Dr)-d-o + speedmax + C Dr= distance raced d=damage o=measue of how much the car was in the middle of track C=10000 to ensure positivity of the fitness (could be negative if drove to other direction or big damage on start) Finally chose the winning Phenotype from the 170 th generation after 19 hours of computation.
D.Diego Perez and Yago Saez:Rule-based controller Evolve set of rules Descretized 4 sensors angle[0,4],trackpos[0,1],speedx[0,3], track[0,2] was done to reduce the search space. Total=5*2*4*3=120 options for inputs Symmerty for the first 2 sensors to simplify the problem Throttle and brake param- a unique value to describe both acceleration and brake by the angle to the track s axis. Descretized effector. Steer [-1,1] with percision of 0.1. Evolutionary Process. Init : a Population of a subset of rules that can finish one lap Fitness = lap-time*0.4+damage*0.6 Selection: Random Uniform selection of a rule-because it depends on all rules together. Uniform crossover Mutation: add -+3 to effectors (but keeping it sane) and -+1 to the rule Than temporarily replaces an existing closest rule with the new one if the fitness is better, it stays. Otherwise, the old status is restored.
E.Chin Hiong Tan and Kay Chen Tan 3 step process(not thoroughly explained) First Process-Sensory data was preprocessed. Second-parametrized controller based on simple rules was designed. Third-The parameters for the controller were optimized using evolution strategies.
תהליך התחרות 2 שלבים שכללו 3 שלב :1 מסלולים: כל משתתף נוסה על כל מסלול לבד 10 פעמים. הציון הנקבע למשתתף עבור מסלול הוא החציון של המרחקים מנקודת ההתחלה של המסלול עבור.game ticks 10000
תהליך התחרות (המשך..) שלב :2 הרצת כל המשתתפים ביחד בכל המסלולים כל מסלול 10 לכל מסלול 3 פעמים סיבובים מיקום התחלתי רנדומלי ציון בדומה לפורמולה 1 8 למקום שני 6 לשלישי 10 למקום ראשון 5 לרביעי 4 לשישי ציון משוקלל חציון הנקודות של כל משתמש על כל 10 ההרצות
תוצאות התחרות+סרטון
התחרות בעתיד התקנה פשוטה יותר שיפור באמינות הסימולטור. תמיכה בריבוי מכוניות וריבוי מסלולים כמאמנים. עוד דוגמאות לנהגים ומאמנים.
סוף